Skip to content

Conversation

@venom1204
Copy link
Contributor

closes #6543
This PR addresses issue #6543 by combining the fragmented DTPRINT statements in fread.c.

in this I

  • Combined separate DTPRINT calls into single statements
  • Maintained conditional formatting for separators
  • Preserved original message content and structure

@MichaelChirico can you please review this when you have time ,
thank you

@venom1204 venom1204 requested a review from aitap as a code owner March 3, 2025 22:24
@codecov
Copy link

codecov bot commented Mar 3, 2025

Codecov Report

Attention: Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.

Project coverage is 98.59%. Comparing base (4f84d3c) to head (b6423fe).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/fread.c 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6848      +/-   ##
==========================================
- Coverage   98.60%   98.59%   -0.02%     
==========================================
  Files          79       79              
  Lines       14657    14661       +4     
==========================================
+ Hits        14453    14455       +2     
- Misses        204      206       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@MichaelChirico MichaelChirico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@MichaelChirico MichaelChirico merged commit 05e3bdf into Rdatatable:master Mar 4, 2025
7 of 11 checks passed
@aitap
Copy link
Member

aitap commented Mar 4, 2025

Restored the translation macros (otherwise potools got a bit confused) and removed the trailing spaces. Please don't add spaces at the end of the line in the future.

@MichaelChirico, would you prefer a test with an ASCII control character separator or a // # nocov here?

By the way, should we be specifying DTPRINT for extraction of translation templates when DTPRINT is defined as Rprintf? I wasn't expecting Rprintf to gettext its arguments, and we do manually translate them in most places.

@MichaelChirico
Copy link
Member

@MichaelChirico, would you prefer a test with an ASCII control character separator or a // # nocov here?

"neither" :)

I think ultimately it should get a test, but don't see any urgency to do so.

I am fine merging some PRs that have small un-tested sections, esp. if the test is unrelated to the PR at hand.

# nocov OTOH is IMO appropriate only when we think it's not reasonable/impossible to test, or such a test would be useless (e.g. requiring so much mocking as to completely obscure what's actually being tested).

By the way, should we be specifying DTPRINT for extraction of translation templates when DTPRINT is defined as Rprintf? I wasn't expecting Rprintf to gettext its arguments, and we do manually translate them in most places.

I think it's like catf(), used for verbose= messages and thus eligible for translation (as Rprintf() should be).

@aitap
Copy link
Member

aitap commented Mar 5, 2025

Oh, I see now. They are extracted thanks to DTPRINT being present in the list, but only marked for translation if the argument is a call to gettext. Messages that are extracted but not marked get reported as untranslated. That's useful.

@MichaelChirico
Copy link
Member

Right... I guess we could (?) rewrite the macro like

#define DTPRINT(s, ...) Rprintf(_(s), __VA_ARGS__)

But I like the consistency of requiring caller(_(string), ...) in C code. I know some authors prefer bringing that over to the R side to, using a t_() shorthand for gettext() everywhere instead of relying on stop() & friends doing that. But I'm OK w the status quo for now.

@aitap
Copy link
Member

aitap commented Mar 5, 2025

The current situation makes perfect sense. I had assumed that the first argument of DTPRINT(...) automatically lands in data.table.pot, but that's not the case. Instead we can either explicitly translate it or mark // #notranslate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fread verbose message about quoting is fragmented

3 participants